package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CourseSchedulesMapper;
import com.ruoyi.system.domain.CourseSchedules;
import com.ruoyi.system.service.ICourseSchedulesService;

/**
 * 环保课程-课时Service业务层处理
 * 
 * @author zrj
 * @date 2025-07-15
 */
@Service
public class CourseSchedulesServiceImpl implements ICourseSchedulesService 
{
    @Autowired
    private CourseSchedulesMapper courseSchedulesMapper;

    /**
     * 查询环保课程-课时
     * 
     * @param scheduleId 环保课程-课时主键
     * @return 环保课程-课时
     */
    @Override
    public CourseSchedules selectCourseSchedulesByScheduleId(Long scheduleId)
    {
        return courseSchedulesMapper.selectCourseSchedulesByScheduleId(scheduleId);
    }

    /**
     * 查询环保课程-课时列表
     * 
     * @param courseSchedules 环保课程-课时
     * @return 环保课程-课时
     */
    @Override
    public List<CourseSchedules> selectCourseSchedulesList(CourseSchedules courseSchedules)
    {
        return courseSchedulesMapper.selectCourseSchedulesList(courseSchedules);
    }

    /**
     * 新增环保课程-课时
     * 
     * @param courseSchedules 环保课程-课时
     * @return 结果
     */
    @Override
    public int insertCourseSchedules(CourseSchedules courseSchedules)
    {
        courseSchedules.setCreateTime(DateUtils.getNowDate());
        return courseSchedulesMapper.insertCourseSchedules(courseSchedules);
    }

    /**
     * 修改环保课程-课时
     * 
     * @param courseSchedules 环保课程-课时
     * @return 结果
     */
    @Override
    public int updateCourseSchedules(CourseSchedules courseSchedules)
    {
        courseSchedules.setUpdateTime(DateUtils.getNowDate());
        return courseSchedulesMapper.updateCourseSchedules(courseSchedules);
    }

    /**
     * 批量删除环保课程-课时
     * 
     * @param scheduleIds 需要删除的环保课程-课时主键
     * @return 结果
     */
    @Override
    public int deleteCourseSchedulesByScheduleIds(Long[] scheduleIds)
    {
        return courseSchedulesMapper.deleteCourseSchedulesByScheduleIds(scheduleIds);
    }

    /**
     * 删除环保课程-课时信息
     * 
     * @param scheduleId 环保课程-课时主键
     * @return 结果
     */
    @Override
    public int deleteCourseSchedulesByScheduleId(Long scheduleId)
    {
        return courseSchedulesMapper.deleteCourseSchedulesByScheduleId(scheduleId);
    }
}
